package com.zjs.controller;


import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

//基础功能模块
@Controller
@RequestMapping(value = "page")
public class BasicController {


    //退出登录
    @RequestMapping(value = "outLogin.action")
    public String  outLogin(HttpServletRequest request){

        //清除session
        request.getSession().removeAttribute("msg");
        request.getSession().removeAttribute("user");

        return "redirect:/login.jsp";
    }


    //转到 staff.jsp页面
    @RequestMapping(value = "base/staff.action",method = {RequestMethod.POST,RequestMethod.GET, })
    public String findStaff(){

        return "base/staff";
    }


    //转到region.jsp页面

    @RequestMapping(value = "base/region.action",method = {RequestMethod.GET,RequestMethod.POST})
    public String findRegion(){

        return "/base/region";
    }



    //转到管理分区页面
    @RequestMapping(value = "base/subarea.action")
    public String findSubArea(){

        return "base/subarea";
    }

    @RequestMapping(value = "/base/decidedzone.action")
    public String findDecideZone(){

        return "base/decidedzone";
    }


    //跳转到 noticebill.jsp
    @RequestMapping("qupai/noticebill/add.action")
    public String  findNoticebill(){


        return "qupai/noticebill_add";
    }


    @RequestMapping(value = "qupai/quickworkorder.action")
    public String findQuickWork(){

        return "qupai/quickworkorder";
    }

    @RequestMapping(value = "qupai/workorderimport.action")
    public String findWorkOrderImport(){
        return "qupai/workorderimport";
    }

    @RequestMapping(value = "admin/userlist.action")
    public String findUserList(){
        return "admin/userlist";
    }
    @RequestMapping(value = "admin/userinfo.action")
    public String findUserInfo(){
        return "admin/userinfo";
    }




    //用户管理模块进入
    @RequiresRoles(value = {"chaojiguanliyuan"})
    @RequestMapping(value = "admin/userindex.action")
    public String findUserIndexPage(){

        return "admin/userindex";
    }

    @RequestMapping(value = "admin/function.action")
    public String findfunctionJsp(){
        return "admin/function";
    }
    @RequestMapping(value = "admin/role.action")
    public String findRolePage(){
        return "admin/role";
    }


}
